package com.service;

import java.util.List;

import com.dao.EmployeesDAO;
import com.domain.Employees;

public class EmployeesService {
	public List<Employees> getAllEmployees() {
		EmployeesDAO dao = new EmployeesDAO();
		return dao.getAllEmployees();
	}

	public Employees getEmployeeById(String code) {
		EmployeesDAO dao = new EmployeesDAO();
		return dao.getEmployeeById(code);
	}

	public int deleteEmployeeById(String employeeId) {
		EmployeesDAO dao = new EmployeesDAO();
		Employees employees = getEmployeeById(employeeId);
		if (employees != null) {
			dao.deleteEmployees(employees);
			return 1;
		} else {
			return 0;
		}
	}

	public void insert(Employees employees) {
		EmployeesDAO dao = new EmployeesDAO();
		dao.insert(employees);
	}

	
}
